package com.itheima.stringdemo;

public class stringDemo9 {
    public static void main(String[] args) {
        //手机号屏蔽
        //1.获取一个手机号码
        String phoneNumber = "13112345678";

        //2.截取字符串
        String start = phoneNumber.substring(0,3);//包头不包尾，包左不包右
        //System.out.println(start);

        //3.截取后四位
        String end = phoneNumber.substring(7);//从7索引开始截取到末尾

        //4.拼接
        String result = start+"****"+end;
        System.out.println(result);
    }
}
